package it.tukano.fun;

/**
 * A function with two parameters that returns null
 * @author pgi
 * @param <PARAM1> the type of the first parameter
 * @param <PARAM2> the type of the second parameter
 */
public abstract class VFunction2<PARAM1, PARAM2> implements Function2<PARAM1, PARAM2, Void> {

    /**
     * Instance initializer
     */
    public VFunction2() {
    }

    /**
     * Calls doApply and returns null
     * @param a the first argument of the function
     * @param b the second argument of the function
     * @return null
     */
    public Void apply(PARAM1 a, PARAM2 b) {
        doApply(a, b);
        return null;
    }

    /**
     * The function body
     * @param a the first argument of the function
     * @param b the second argument of the function
     */
    public abstract void doApply(PARAM1 a, PARAM2 b);
}
